package com.chrray.position.controller.web;


import com.chrray.position.pojo.request.web.IndexDto;
import com.chrray.position.pojo.vo.web.*;
import com.chrray.position.service.web.WFdIndexService;
import com.chrray.position.util.redis.RedisUtils;
import com.chrray.position.util.result.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


import java.util.List;

import static com.chrray.position.util.result.ResponseResults.success;

/**
 * 周冠军
 *
 * @author lm
 */
@RestController
@RequestMapping("/api/web/screen")
@Api(value = "大屏", tags = "大屏")
public class IndexController {

    @Autowired
    private RedisUtils redisUtils;

    @Autowired
    private  WFdIndexService wFdIndexService;

    /**
     * 查询全部 周冠军
     */
    @ApiOperation(value = "职位总览")
    @GetMapping(value = "/positionStatics")
    public ResponseResult<PositionStaticsVo> positionStatics() {
        return wFdIndexService.positionStatics();

    }


    @ApiOperation(value = "用户总览")
    @GetMapping(value = "/userStatics")
    public ResponseResult<UserStaticsVo> userStatics() {
        return wFdIndexService.userStatics();
    }

    @ApiOperation(value = "职位统计-左")
    @GetMapping(value = "/positionStaticsLeft")
    public ResponseResult<PositionStaticsLeftVo> positionStaticsLeft() {
        return wFdIndexService.positionStaticsLeft();

    }

    @ApiOperation(value = "职位统计-右")
    @GetMapping(value = "/positionStaticsRight")
    public ResponseResult<List<PositionStaticsRightVo>> positionStaticsRight(IndexDto indexDto) {
        return wFdIndexService.positionStaticsRight(indexDto);

    }

    @ApiOperation(value = "用户统计-左")
    @GetMapping(value = "/userStaticsLeft")
    public ResponseResult<UserStaticsLeftVo> userStaticsLeft() {
        return wFdIndexService.userStaticsLeft();

    }

    @ApiOperation(value = "用户统计-右")
    @GetMapping(value = "/userStaticsRight")
    public ResponseResult<List<UserStaticsRightVo>> userStaticsRight(IndexDto indexDto) {
        return wFdIndexService.userStaticsRight(indexDto);

    }
}

